package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.FaqService;
import com.ccys.cms.service.masterData.FaqTypeService;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.*;
import com.ccys.db.vo.masterData.FaqFindListVo;
import com.ccys.db.vo.masterData.FaqTypeFindListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: WhiteCoat
 * @description: FAQ接口(包含Type)
 * @author: ZhangJingCan
 * @create: 2023-12-12 14:51
 **/

@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-FAQ接口(包含Type)")
public class FaqController {

    @Autowired
    private FaqTypeService faqTypeService;

    @Autowired
    private FaqService faqService;


    
    @PostMapping("faqType")
    @ApiOperation("保存FaqType")
    public ResponseResult saveFaqType(FaqTypeSaveDto dto) {
        return faqTypeService.saveFaqType(dto);
    }

    @PutMapping("faqType")
    @ApiOperation("修改FaqType")
    public ResponseResult editFaqType(FaqTypeSaveDto dto) {
        return faqTypeService.saveFaqType(dto);
    }
    
    @DeleteMapping("faqType")
    @ApiOperation("根据ID删除FaqType")
    public ResponseResult deleteFaqType(FaqTypeDelDto dto) {
        return faqTypeService.deleteFaqType(dto);
    }

    
    @GetMapping("faqType")
    @ApiOperation("根据条件查询FaqType集合")
    public ResponseResult<List<FaqTypeFindListVo>, Object> findListFaqType(FaqTypeFindListDto dto) {
        return faqTypeService.findListFaqType(dto);
    }

    //==============================上面是FaqType===========下面是Faq=================================

    
    @PostMapping("faq")
    @ApiOperation("保存Faq")
    public ResponseResult saveFaq(FaqSaveDto dto) {
        return faqService.saveFaq(dto);
    }

    @PutMapping("faq")
    @ApiOperation("修改Faq")
    public ResponseResult editFaq(FaqSaveDto dto) {
        return faqService.saveFaq(dto);
    }

    @DeleteMapping("faq")
    @ApiOperation("根据ID删除Faq")
    public ResponseResult deleteFaq(FaqDelDto dto) {
        return faqService.deleteFaq(dto);
    }

    
    @GetMapping("faq")
    @ApiOperation("根据条件查询Faq集合")
    public ResponseResult<List<FaqFindListVo>, Object> findListFaq(FaqFindListDto dto) {
        return faqService.findListFaq(dto);
    }


}
